/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.netcracker.test.eleven;

import java.util.concurrent.Callable;

/**
 *
 * @author I
 */
public class MergeSortCallable2 implements Callable<Integer[]> {
    Integer[] arr;
    public MergeSortCallable2(Integer[] arr){
        this.arr=arr;
    }
    @Override
    public Integer[] call(){
       return IntToInteger(MergeSort.mergesort(integerToInt(arr)));
    }
    
    public int[] integerToInt(Integer[] arr){
        int array[] = new int[arr.length];
        for (int i = 0; i < arr.length; i++) {
            array[i]=arr[i].intValue();
        }
        return array;
    }
    public final Integer[] IntToInteger(int[] arr){
        Integer[] array = new Integer[arr.length];
        for (int i = 0; i < arr.length; i++) {
            array[i]=arr[i];
        }
        return array;
    }
}
